package top.zhangjianyong.blog.manage.controller;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.zhangjianyong.blog.params.common.SendVCodeParam;
import top.zhangjianyong.blog.response.ApiResponse;
import top.zhangjianyong.blog.service.CommonService;

/**
 * 通用Controller
 *
 * @author zhangjianyong
 * @since 2024/7/19 下午7:38
 */
@RequestMapping("/common")
@RestController
public class CommonController {

  private final CommonService commonService;

  public CommonController(CommonService commonService) {
    this.commonService = commonService;
  }

  /*发送验证码*/
  @PostMapping("/sendVCode")
  public ApiResponse sendVCode(@RequestBody @Validated SendVCodeParam param) {
    return commonService.sendVCode(param);
  }
}
